<head>
    <meta name="referrer" content="never">
</head>
<div ng-controller="GzhmenuCtrl" ng-init="listAction()">
    <ul class="sui-breadcrumb">
        <li>{{'菜单管理'|translate}}</li>
        <li class="active"> {{'选择公众号：' | translate}}
            <wx-app-list ng-model="wxappid" dft="1" ary="storeary" xc="1" callbacks="wxgzhcallback(app_id)"> </wx-app-list>
        </li>
    </ul>
    <div class="sui-row-fluid" style="margin-left:40px;margin-top: 6px ">
        <div class="span4 gzhmenu1">
            <div style="width:320px;border:1px solid #aaa;height: 485px;background: transparent url('https://res.wx.qq.com/mpres/htmledition/images/bg/bg_mobile_head_default3a7b38.png') no-repeat 0 0;">
                <div class="mobile_hd">
                    {{storeary.nick_name}}
                </div>
                <div class="caidan">
                    <div id="menunav">
                        <ul id="menuul" as-sortable="sortableOptions" data-ng-model="itemsList">
                            <li class="menuli" ng-repeat="item in itemsList" as-sortable-item>
                                <a href="javascript:void(0);" as-sortable-item-handle ng-click="clickBtn(item.name,item)" class="sui-btn btn-bordered btn-xlarge" id="{{item.name}}">{{item.name}}</a>
                                <div style="margin-top: -311px">
                                    <ul style="padding-left:1px" as-sortable="sortableCloneOptions" data-ng-model="item">
                                        <li ng-repeat="data in item.sub_button.list" as-sortable-item style="border: none;">
                                            <a href="javascript:void(0);" ng-click="clickModular(data)" class="sui-btn btn-bordered btn-xlarge menu-ellipsis" as-sortable-item-handle>{{data.name}}</a>
                                        </li>
                                        <li ng-if="item.sub_button.list.length <5 || !item.sub_button">
                                            <a href="javascript:void(0);" ng-click="addModular(item.$$hashKey,item)" class="sui-btn btn-bordered btn-xlarge"><i class="sui-icon icon-touch-plus"></i></a>
                                        </li>
                                    </ul>
                                </div>
                            </li>
                            <li class="menuli" ng-if="itemsList.length<3">
                                <a href="javascript:void(0);" ng-click="addBtn()" class="sui-btn btn-bordered btn-xlarge">
                                    <i class="sui-icon icon-touch-plus"></i>
                                </a>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <div class="span4">
            <div ng-show="clickData" style="height: 485px;width:595px;border:1px solid rgb(247, 234, 234);background-color: #f4f5f9;">
                <div class="menuinfo sui-form form-horizontal">
                    <div class="title_bar menumer">
                        <h4 style="font-weight: 400;">{{clickData.name}}</h4>
                        <div class="global_extra">
                            <a href="javascript:void(0);" ng-click="derBtn(clickData)">删除子菜单</a>
                        </div>
                    </div>
                    <div class="menumer">
                        <hr>
                    </div>
                    <div class="menumer" ng-show="clickData.sub_button">
                        <span class="tishi1">已添加子菜单，仅可设置菜单名称。</span>
                    </div>
                    <div class="menumer " ng-show="clickData.subtype ==1 ">
                        菜单名称：
                        <input ng-model="clickData.name" value="" name="sale_num">
                        <br/>
                        <div class="menumer tishi2">字数不超过4个汉字或8个字母</div>
                    </div>
                    <div class="menumer" ng-show="clickData.subtype ==2">
                        子菜单名称：
                        <input ng-model="clickData.name" value="" name="sale_num">
                        <br/>
                        <div class="menumer tishi3">字数不超过8个汉字或16个字母</div>
                    </div>
                    <div class="menumer" ng-show="clickData.subtype ==2 || !clickData.sub_button">
                        <div>
                            <span ng-show="clickData.subtype ==1 "> 菜单内容：</span>
                            <span ng-show="clickData.subtype ==2"> 子菜单内容：</span>
                            <span>
                            <input type="radio" name="type" ng-model="clickData.type"  ng-value="'media_id'" class="input-xlarge" required />发送消息 </label>
                            <input type="radio" name="type" ng-model="clickData.type" ng-value="'view'" class="input-xlarge" required />跳转网页 </label>
                            <input type="radio" name="type" ng-model="clickData.type" ng-value="'miniprogram'" class="input-xlarge" required />跳转小程序 </label>
                            </span>
                        </div>
                        <div class="menu-text">
                            <div ng-show="clickData.type == 'media_id'" class="type-text">
                                <div class="menumer" style="padding: 16px 20px;">
                                    <ul style="display:balock;line-height: 65px;">
                                        <li class="hengli " >
                                            <a href="javascript:void(0);" ng-click="subclick('news')"><i class="sui-icon icon-list"></i>图文消息</a>
                                        </li>
                                        <li class="hengli tupian">
                                            <a href="javascript:void(0);" ng-click="subclick('img')"><i class="sui-icon icon-picture"></i>图片</a>
                                        </li>
                                        <!-- <li class="hengli yuyin"><a href="javascript:void(0);"><i class="sui-icon icon-volume-up"></i>语音</a></li>
                                        <li class="hengli shipin"><a href="javascript:void(0);"><i class="sui-icon icon-play-circle"></i>视频</a></li> -->
                                    </ul>
                                </div>
                                <div ng-show="clickData.sub_click_type =='news'">
                                    <div class="menu-news" ng-show="!clickData.news_info">
                                        <get-gzh-sucai-list wxappid="wxappid" callbacks="ballckData(data)" type="1"></get-gzh-sucai-list>
                                        <div style="margin-left: 159px;margin-top: -34px;">
                                            <a href="#/article/add?wxappid={{wxappid}}">
                                            <i  style="margin-left: 15px;"  class="sui-icon icon-pencil"></i>
                                            <br/><strong>自建图文</strong>
                                        </a>
                                        </div>
                                    </div>
                                    <div ng-show="clickData.news_info">
                                        <div class="menu-newss">
                                            <div class="menu-newss-content">{{clickData.news_info.list[0].author}}</div>
                                            <div class="menu-newss-content">
                                                <img ng-src="{{clickData.news_info.list[0].thumb_url}}">
                                            </div>
                                            <div class="menu-newss-content">{{clickData.news_info.list[0].title}}</div>
                                        </div>
                                        <div style="margin-top: -38px;margin-left: 330px;">
                                            <a style="color:red" href="javascript:void(0);" ng-click="derNews(clickData)">删除</a>
                                        </div>
                                    </div>
                                </div>
                                <div ng-show="clickData.sub_click_type =='img'">
                                    <div class="menu-img">
                                        <wx-gzh-url-attachment id="'dasdasd'" owner-id="attachs" dhf-ng-model="attchUrl" xtype="mid " mult="false " title="从素材库选择 " use-type="png,jpeg,gif,jpg,JPG,PNG,JPEG,GIF " wxappid="wxappid" setback="addimgurl(attach) " datatype="1"></wx-gzh-url-attachment>
                                    </div>
                                    <div class="menu-newss-content" ng-show="clickData.media_id">
                                        <!-- <kefu-img ng-model="clickData.media_id" appid="wxapp_id" apply-type="session_reply_info"></kefu-img> -->
                                        <img ng-src="{{clickData.url}}" style="width: 200px;height:200px">
                                    </div>
                                </div>
                            </div>
                            <div ng-show="clickData.type == 'view' " class="type-wangye">
                                <div class="menumer">
                                    <span class="view1">订阅者点击该子菜单会跳到以下链接</span>
                                </div>
                                <div class="menumer">
                                    页面地址 ：
                                    <input ng-model="clickData.url" value="" name="sale_num">
                                    <div class="menumer tishi2" ng-show="clickData.sucai">
                                        来自-素材《{{clickData.sucai}}》
                                    </div>
                                    <br/>
                                    <div class="menumer tishi2">
                                        <get-gzh-sucai-list wxappid="wxappid" callbacks="ballckUrl(data)"></get-gzh-sucai-list>
                                    </div>
                                </div>
                            </div>
                            <div ng-show="clickData.type == 'miniprogram' " class="type-wangye">
                                <div class="menumer">
                                    <span class="view1">订阅者点击该子菜单会跳到以下小程序</span>
                                </div>
                                <div class="menumer wxapptitle">
                                    小程序 ：
                                    <wxapplet id="wxapplet" callback="appletback(attach,clickData)" ngclass="sui-btn btn-xlarge" wxgzhappid="wxappid" sbutype="1"></wxapplet>
                                </div>
                                <div class="menumer wxapptitle" ng-show="clickData.appid">
                                    小程序id ：
                                    <input ng-model="clickData.appid" value="" name="sale_num">
                                </div>
                                <div class="menumer wxapptitle" ng-show="clickData.pagepath">
                                    小程序路径 ：
                                    <input ng-model="clickData.pagepath" value="" name="sale_num" style="width: 400px;">
                                </div>
                                <div class="menumer wxapptitle">
                                    备用网页 ：
                                    <input ng-model="clickData.url" value="" name="sale_num">
                                    <br/>
                                    <span class="view1 wxappidtishi">旧版微信客户端无法支持小程序，用户点击菜单时将会打开备用网页。</span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div ng-show="!clickData" class="nocenter">
            点击左侧菜单进行编辑操作
        </div>
    </div>
    <div class="menufoot">
        <button class="sui-btn btn-xlarge btn-success menucenter" ng-click="saveMenu()">保存并发布</button>
    </div>
</div>